package cjyyp.handler;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.kafka.annotation.TopicPartition;

@Configuration
@Slf4j
public class KafkaConsumerHandler {
    // 指定要监听的 topic
//    @KafkaListener(topics = {"first"})
    @KafkaListener(topicPartitions = {
            @TopicPartition(topic = "first", partitions = {"0"})
    })
    public void consumeTopic(String msg) { // 参数: 收到的 value
        log.info("收到的信息:[{}]",msg);
    }
}
